package cn.touna.jss.common.util;

import com.alibaba.fastjson.JSONObject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 埋点事件工具类
 * @Author:zhangjialian
 * @Description:
 * @Date:2018/4/28 11:35
 */
public class ClickUtil {

    private static final Logger logger = LogManager.getLogger(ClickUtil.class);
    private static final String CLICK_DATATYPE="click";
    private static final String CLICK_DATASOURCE="003";


    /**
     * 埋点事件组装数据
     */

    public static JSONObject genClickData(String phoneNo,String idCard,JSONObject subReult,String methodName) {
        JSONObject msg=new JSONObject();
        msg.put("bizType",methodName);
        msg.put( "dataType", CLICK_DATATYPE);
        msg.put("dataSource",CLICK_DATASOURCE);
        JSONObject data=new JSONObject();
        data.put("phone_no",phoneNo);
        data.put("id_card",idCard);
        data.put(methodName,subReult);
        msg.put("data",data);
        return msg;
    }

}
